package com.foxzzz.deep.first;

import com.foxzzz.base.TreeNode;

/**
 * @author: [wujie]
 * @createTime: [2019/12/11 18:42]
 * @description:
 */
public class Solution104 {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
    }


    public static void main(String[] args) {
        TreeNode treeNode = TreeNode.getTreeNode("[3,9,20,null,null,15,7]");
        System.out.println(new Solution104().maxDepth(treeNode));

    }
}
